package com.wln.kms.kms.controller;

import java.util.Arrays;
import java.util.Map;

import com.wln.kms.kms.vo.BargainVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import com.wln.kms.kms.entity.BargainActivityEntity;
import com.wln.kms.kms.service.BargainActivityService;
import com.wln.common.utils.PageUtils;
import com.wln.common.utils.R;



/**
 * 
 *
 * @author wulinna
 * @email 2258732595@qq.com
 * @date 2022-03-10 10:47:57
 */
@RestController
@RequestMapping("kms/bargainactivity")
public class BargainActivityController {
    @Autowired
    private BargainActivityService bargainActivityService;

    /**
     * 列表
     */
    @RequestMapping("/list")
    public R list(@RequestParam Map<String, Object> params){
        PageUtils page = bargainActivityService.queryPage(params);

        return R.ok().put("page", page);
    }


    /**
     * 信息
     */
    @RequestMapping("/info/{activityHid}")
    public R info(@PathVariable("activityHid") Long activityHid){
		BargainActivityEntity bargainActivity = bargainActivityService.showinfo(activityHid);

        return R.ok().put("bargainActivity", bargainActivity);
    }



    /**
     * 保存
     */
    @RequestMapping("/save")
    public R save(@RequestBody BargainActivityEntity bargainActivity){
		bargainActivityService.save(bargainActivity);

        return R.ok();
    }

    /**
     * 修改
     */
    @RequestMapping("/update")
    public R update(@RequestBody BargainActivityEntity bargainActivity){
		bargainActivityService.updateById(bargainActivity);

        return R.ok();
    }

    /**
     * 删除
     */
    @RequestMapping("/delete")
    public R delete(@RequestBody Long[] activityHids){
		bargainActivityService.removeByIds(Arrays.asList(activityHids));

        return R.ok();
    }

}
